/************************************************************************************
 **   Project: Crypteur / Decrypteur d'IP
 **
 **   Version : 0.1 Alpha
 **
 **   Librairie : QT by Throll Tech
 **
 **   START AT :	30 mars 2009
 **
 **   LAST UPDATE : 10 avril 2009 : 15:33
 **
 **   STATUS : Active ...
 **
 **   Copyright (C) 2009 by skyhate
 **
 **   This program is free software; you can redistribute it and/or modify
 **   it under the terms of the GNU General Public License as published by
 **   the Free Software Foundation; either version 2 of the License, or
 **   (at your option) any later version.
 **
 **   This program is distributed in the hope that it will be useful,
 **   but WITHOUT ANY WARRANTY; without even the implied warranty of
 **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 **   GNU General Public License for more details.
 **
 **   You should have received a copy of the GNU General Public License
 **   along with this program; if not, write to the Free Software
 **   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **
 ************************************************************************************/

#include <QApplication>
#include <QtGui>
#include <QByteArray>
#include "KeyList.h" <-- The table of Key for the Decrypter .
#include "Fenetre.h"
#include <stdio.h>


// -- Fonction don't need anymore ...
void AddFile(FILE * file ){
    QString sortie = "";Fenetre *in = new Fenetre;
    qulonglong total, nombre_unsigned[5]  = {0,0,0,0},tmp_[5] = {1,1,1,1};

    
 while(( nombre_unsigned[0] &&
         nombre_unsigned[1] &&
         nombre_unsigned[2] &&
         nombre_unsigned[3] ) != 255 )
    {
        for( int i = 0; i < 4 ; i++ ){ nombre_unsigned[i] = tmp_[i]; }

        nombre_unsigned[0] = nombre_unsigned[0]*16777216;
        nombre_unsigned[1] = nombre_unsigned[1]*65536;
        nombre_unsigned[2] = nombre_unsigned[2]*256;
        nombre_unsigned[3] = nombre_unsigned[3]*128;

        total = nombre_unsigned[0]+nombre_unsigned[1]+nombre_unsigned[2]+nombre_unsigned[3];
        /*if ( tmp_[0] < 2
        if ( tmp_[1] < 256 && tmp_[2] == 0 && tmp_[1] == 0 ) { tmp_[1]++; }*/
        // Si tmp2 est moins de 256 et que tmp3 égale alors tmp2++
        if ( tmp_[2] < 256 && tmp_[3] == 0 ) { tmp_[2]++; }
        // Si tmp3 a moins de 256 tmp3++
        if ( tmp_[3] < 256 ){ tmp_[3]++; }


        if(tmp_[3]==255){ tmp_[3] = 0; tmp_[2]++; }
        if(tmp_[2]==255){ tmp_[2] = 0; tmp_[1]++; }
        if(tmp_[1]==255){ tmp_[1] = 0; tmp_[0]++; }
        if(tmp_[0]==255){ QMessageBox::information(new QWidget,"Fini!","Voilà!"); }

        sortie = in->HASHMD5(total);
        //fputs(QByteArray(sortie.toAscii()).constData(),file);


    }


}





int main(int argc, char *argv[])
{

	QApplication app(argc, argv);

        Fenetre fenetre;

        fenetre.show();

	return app.exec();

}
